/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ControlLayer;

/**
 *
 * @author Evil
 */
public class PriceCalculator
{
    double taxPercentage = 25;
    double greentaxPercentage = 5;
    double earningsPercentage = 10;

    public static PriceCalculator instance;

    public static PriceCalculator getInstance()
    {
        if (instance == null)
        {
            instance = new PriceCalculator();
        }

        return instance;
    }

    private PriceCalculator()
    {
    }

    public double calculatePrice(double price)
    {
        double calculatedPrice = price;
        calculatedPrice += ((calculatedPrice / 100) * greentaxPercentage);
        calculatedPrice += ((calculatedPrice / 100) * earningsPercentage);

        return calculatedPrice;
    }

    public double calculateTax(double price)
    {
        return price + ((price / 100) * taxPercentage);
    }
}
